<!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>EC AWS</title>
<%include file="_head.html"/>
</head>
<body>

<div class="navbar navbar-fixed-top">

<%include file="_header.html" />

</div>

<div class="container-fluid">

<div class="row-fluid">

<div class="span2">
<!--Sidebar content-->
    <%include file="_sidebar.html" />
</div>
<div class="span10">
    <div id="content">
        %if id:
        <%include file="_tabmenu.html" />
        %endif

        <h1>PANEO EC AWS
        %if mode != 'view':
        <a href="/paneo/ecaws/" class="btn" style="margin-left:30px;">一覧に戻る</a>
        %endif
        </h1>
        %if mode == 'view' :
        <%include file="_page_list.html" args="edit='ecaws'"/>
        %endif:
        <!-- form -->
        %if id :
        <form class="form-horizontal"  enctype="multipart/form-data" method="POST">
        <fieldset>
        <legend>[ ${id} ] EC AWS 編集
        
        %if scfg.get('PAGEMAKE') == 'CMS':
        <a href="/${id}.html" target="_blank" class="icon-share-alt">
        <span class="label">
        ページ表示
        </span>
        </a>
        %else:
        <a href="/${id}.html" target="_blank" class="icon-share-alt">
        <span class="label">
        ページ表示
        </span>
        </a>
        %endif
        
        </legend>

            %for k,v in sorted( html_fields.items(), key=lambda x:x[1].get('idx')):
            <% ext = v.get('ext',{}) %>
            <div class="control-group">

            %if ext.get('view') == 'item':
            <% asin = ext.get('asin',{}) %>
            <label class="control-label" for="${k}">
            ${v.get('title')} type: ${ext.get('view')} name:${v.get('name')}
            </label>
            <div class="controls">
            <span class="label help-block">ITEM 設定</span>
            <hr>
            %for ii in range(1,11):
            <span>ASIN${"%02d"%ii}:</span><input type="text" id="${k}_asin_${ii}" name="${k}_asin_${ii}" class="input-middle" value="${asin.get('I:%s'%ii)}">
            <br>
            %endfor
            </div>
            </div>
            <hr>
            %endif

            %if ext.get('view') == 'search':
            <label class="control-label" for="${k}">
            ${v.get('title')} type: ${ext.get('view')} name:${v.get('name')}
            </label>
            <div class="controls">
            <span class="label help-block">SEARCH 設定</span>
            <hr>

            <div class="row-fluid">
            <span class="span3">INDEX:</span>
            <select name="SEARCHINDEX">
            %for kk,vv in AWS_SEARCH_INDEX.items():
            <option value="${kk}" ${ "selected" if kk == ext.get('searchindex') else "" } >${vv}</option>
            %endfor
            </select>
            </div>

            <div class="row-fluid">
            <span class="span3">KEYWORD:</span>
            <input class="span6" type="text" name="KW" value="${ext.get('kw')}">
            </div>

            <div class="row-fluid">
            <span class="span3">ページ番号:</span>
            <input class="span1" type="text" name="ITEMPAGE" value="${ext.get('itempage')}">
            </div>

            <div class="row-fluid">
            <span class="span3">並び替え:</span>
            <select name="SORT">
            %for kk,vv in AWS_SORT.items():
            <option value="${kk}" ${ "selected" if kk == ext.get('sort') else "" } >${vv}</option>
            %endfor
            </select>
            </div>

            </div>
            <hr>
            %endif

            %endfor

            <div class="form-actions">
                <button class="btn btn-primary" type="submit">更新する</button>
                <button class="btn" type="reset" style="margin-left:20px;">Cancel</button>
            </div>
        </fieldset>
        </form>
        %endif
    </div><!--/div#content row span-->
</div>

</div><!--/row-->

</div><!--/container-fluid"-->

<hr>

<%include file="_footer.html" />

</div><!--/.fluid-container-->

</body>
</html>


